<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkMenuBar</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 3 参考手册">
<link rel="up" href="MenusAndCombos.html" title="菜单、组合框和工具栏">
<link rel="prev" href="gtk3-GtkMenu.html" title="GtkMenu">
<link rel="next" href="gtk3-GtkMenuItem.html" title="GtkMenuItem">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gtk3-GtkMenu.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="MenusAndCombos.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 3 参考手册</th>
<td><a accesskey="n" href="gtk3-GtkMenuItem.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk3-GtkMenuBar.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gtk3-GtkMenuBar.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gtk3-GtkMenuBar"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-GtkMenuBar.top_of_page"></a>GtkMenuBar</span></h2>
<p>GtkMenuBar — A subclass of GtkMenuShell which holds GtkMenuItem widgets</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gtk3-GtkMenuBar.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

struct              <a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar">GtkMenuBar</a>;
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkMenuBar.html#gtk-menu-bar-new" title="gtk_menu_bar_new ()">gtk_menu_bar_new</a>                    (<em class="parameter"><code><span class="type">void</span></code></em>);
enum                <a class="link" href="gtk3-GtkMenuBar.html#GtkPackDirection" title="enum GtkPackDirection">GtkPackDirection</a>;
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenuBar.html#gtk-menu-bar-set-pack-direction" title="gtk_menu_bar_set_pack_direction ()">gtk_menu_bar_set_pack_direction</a>     (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar"><span class="type">GtkMenuBar</span></a> *menubar</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkMenuBar.html#GtkPackDirection" title="enum GtkPackDirection"><span class="type">GtkPackDirection</span></a> pack_dir</code></em>);
<a class="link" href="gtk3-GtkMenuBar.html#GtkPackDirection" title="enum GtkPackDirection"><span class="returnvalue">GtkPackDirection</span></a>    <a class="link" href="gtk3-GtkMenuBar.html#gtk-menu-bar-get-pack-direction" title="gtk_menu_bar_get_pack_direction ()">gtk_menu_bar_get_pack_direction</a>     (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar"><span class="type">GtkMenuBar</span></a> *menubar</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenuBar.html#gtk-menu-bar-set-child-pack-direction" title="gtk_menu_bar_set_child_pack_direction ()">gtk_menu_bar_set_child_pack_direction</a>
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar"><span class="type">GtkMenuBar</span></a> *menubar</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkMenuBar.html#GtkPackDirection" title="enum GtkPackDirection"><span class="type">GtkPackDirection</span></a> child_pack_dir</code></em>);
<a class="link" href="gtk3-GtkMenuBar.html#GtkPackDirection" title="enum GtkPackDirection"><span class="returnvalue">GtkPackDirection</span></a>    <a class="link" href="gtk3-GtkMenuBar.html#gtk-menu-bar-get-child-pack-direction" title="gtk_menu_bar_get_child_pack_direction ()">gtk_menu_bar_get_child_pack_direction</a>
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar"><span class="type">GtkMenuBar</span></a> *menubar</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gtk3-GtkMenuBar.description"></a><h2>Description</h2>
<p>
The <a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar"><span class="type">GtkMenuBar</span></a> is a subclass of <a class="link" href="gtk3-GtkMenuShell.html#GtkMenuShell" title="struct GtkMenuShell"><span class="type">GtkMenuShell</span></a> which contains one or
more <a href="gtk3-GtkMenuItem.html#GtkMenuItem"><span class="type">GtkMenuItems</span></a>. The result is a standard menu bar which can hold
many menu items.
</p>
</div>
<div class="refsect1">
<a name="gtk3-GtkMenuBar.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GtkMenuBar"></a><h3>struct GtkMenuBar</h3>
<pre class="programlisting">struct GtkMenuBar {
  GtkMenuShell menu_shell;
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-bar-new"></a><h3>gtk_menu_bar_new ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_menu_bar_new                    (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Creates a new <a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar"><span class="type">GtkMenuBar</span></a>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the new menu bar, as a <a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GtkPackDirection"></a><h3>enum GtkPackDirection</h3>
<pre class="programlisting">typedef enum {
  GTK_PACK_DIRECTION_LTR,
  GTK_PACK_DIRECTION_RTL,
  GTK_PACK_DIRECTION_TTB,
  GTK_PACK_DIRECTION_BTT
} GtkPackDirection;
</pre>
<p>
Determines how widgets should be packed insided menubars
and menuitems contained in menubars.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GTK-PACK-DIRECTION-LTR:CAPS"></a><span class="term"><code class="literal">GTK_PACK_DIRECTION_LTR</code></span></p></td>
<td>Widgets are packed left-to-right
</td>
</tr>
<tr>
<td><p><a name="GTK-PACK-DIRECTION-RTL:CAPS"></a><span class="term"><code class="literal">GTK_PACK_DIRECTION_RTL</code></span></p></td>
<td>Widgets are packed right-to-left
</td>
</tr>
<tr>
<td><p><a name="GTK-PACK-DIRECTION-TTB:CAPS"></a><span class="term"><code class="literal">GTK_PACK_DIRECTION_TTB</code></span></p></td>
<td>Widgets are packed top-to-bottom
</td>
</tr>
<tr>
<td><p><a name="GTK-PACK-DIRECTION-BTT:CAPS"></a><span class="term"><code class="literal">GTK_PACK_DIRECTION_BTT</code></span></p></td>
<td>Widgets are packed bottom-to-top
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-bar-set-pack-direction"></a><h3>gtk_menu_bar_set_pack_direction ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_bar_set_pack_direction     (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar"><span class="type">GtkMenuBar</span></a> *menubar</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkMenuBar.html#GtkPackDirection" title="enum GtkPackDirection"><span class="type">GtkPackDirection</span></a> pack_dir</code></em>);</pre>
<p>
Sets how items should be packed inside a menubar.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menubar</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar"><span class="type">GtkMenuBar</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>pack_dir</code></em> :</span></p></td>
<td>a new <a class="link" href="gtk3-GtkMenuBar.html#GtkPackDirection" title="enum GtkPackDirection"><span class="type">GtkPackDirection</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-bar-get-pack-direction"></a><h3>gtk_menu_bar_get_pack_direction ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkMenuBar.html#GtkPackDirection" title="enum GtkPackDirection"><span class="returnvalue">GtkPackDirection</span></a>    gtk_menu_bar_get_pack_direction     (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar"><span class="type">GtkMenuBar</span></a> *menubar</code></em>);</pre>
<p>
Retrieves the current pack direction of the menubar. 
See <a class="link" href="gtk3-GtkMenuBar.html#gtk-menu-bar-set-pack-direction" title="gtk_menu_bar_set_pack_direction ()"><code class="function">gtk_menu_bar_set_pack_direction()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menubar</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar"><span class="type">GtkMenuBar</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the pack direction</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-bar-set-child-pack-direction"></a><h3>gtk_menu_bar_set_child_pack_direction ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_bar_set_child_pack_direction
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar"><span class="type">GtkMenuBar</span></a> *menubar</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkMenuBar.html#GtkPackDirection" title="enum GtkPackDirection"><span class="type">GtkPackDirection</span></a> child_pack_dir</code></em>);</pre>
<p>
Sets how widgets should be packed inside the children of a menubar.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menubar</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar"><span class="type">GtkMenuBar</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>child_pack_dir</code></em> :</span></p></td>
<td>a new <a class="link" href="gtk3-GtkMenuBar.html#GtkPackDirection" title="enum GtkPackDirection"><span class="type">GtkPackDirection</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-bar-get-child-pack-direction"></a><h3>gtk_menu_bar_get_child_pack_direction ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkMenuBar.html#GtkPackDirection" title="enum GtkPackDirection"><span class="returnvalue">GtkPackDirection</span></a>    gtk_menu_bar_get_child_pack_direction
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar"><span class="type">GtkMenuBar</span></a> *menubar</code></em>);</pre>
<p>
Retrieves the current child pack direction of the menubar.
See <a class="link" href="gtk3-GtkMenuBar.html#gtk-menu-bar-set-child-pack-direction" title="gtk_menu_bar_set_child_pack_direction ()"><code class="function">gtk_menu_bar_set_child_pack_direction()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menubar</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar"><span class="type">GtkMenuBar</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the child pack direction</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.8</p>
</div>
</div>
<div class="refsect1">
<a name="gtk3-GtkMenuBar.see-also"></a><h2>See Also</h2>
<a class="link" href="gtk3-GtkMenuShell.html#GtkMenuShell" title="struct GtkMenuShell"><span class="type">GtkMenuShell</span></a>, <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>, <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>